package net.lunjin.controller;

import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("operation")
public class OperationController {

	@RequestMapping( value="/calendar{jspid}.html" )
	public String calendar(@PathVariable int jspid,HttpServletRequest request) throws Exception {
		request.setAttribute("jspid", jspid>7?7:jspid);
		return "/operation/calendar";
	}
	
	@RequestMapping( value="/priceview{imgid}.html" )
	public String priceview(@PathVariable int imgid,HttpServletRequest request) throws Exception {
		String imgUrl = "";
		if(imgid==0){
			imgUrl = "http://www.kitco.cn/cn/live_charts/goldcn_600x400.gif";
		}else if(imgid==1){
			imgUrl = "http://www.kitco.cn/cn/live_charts/silvercny.gif";
		}else if(imgid==2){
			imgUrl = "http://www.kitco.cn/cn/live_charts/platicny.gif";
		}else if(imgid==3){
			imgUrl = "http://www.kitco.cn/cn/live_charts/pladcny.gif";
		}
		request.setAttribute("imgid", imgid);
		request.setAttribute("imgUrl", imgUrl);
		return "/operation/priceview";
	}
}
